package no.ntnu.fp.services.impl;

import java.io.IOException;

import no.ntnu.fp.messages.Message;
import no.ntnu.fp.messages.impl.GetEmployeesMessage;
import no.ntnu.fp.messages.impl.LoginMessage;
import no.ntnu.fp.net.co.Connection;
import no.ntnu.fp.services.EmployeeService;

public class EmployeeServiceImpl extends EntityServiceImpl implements EmployeeService {

	public EmployeeServiceImpl(Connection connection) {
		super(connection);
	}

	@Override
	public void logInEmployeeByCredentials(String username, String password) throws IOException {
		LoginMessage message = new LoginMessage(username, password);
		connection.send(message.toString());
	}

	@Override
	public void fetchAllEmployees() throws IOException {
		Message message = new GetEmployeesMessage();
		connection.send(message.toString());
	}
}